<?php
/*
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 * $Id: 2017-12-13 03:39:35 apple $
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
if($_RQ['op']=='main'){
	$id=$_RQ['id']?:$_RQ['paidian'];
	if(!$id){
		exi('请选择旅拍点！','error');
	}
	$paidian=pdo_get('jy_lvpai_paidian',array('id'=>$id,'uniacid'=>$_SESSION['uniacid']));
	$return['list']=array();
	$return['paidian_info']=$this->paidian_info;
	foreach($return['paidian_info'] as &$pv){
		if($pv['url']=='dangqiurl'){
			$pv['url']=$paidian['dangqiurl']?:'';
		}
		if($pv['url']=='vrurl'){
			$pv['url']=$paidian['vrurl']?:'';
		}
	}
	$return['paidian_title']=$paidian['title'];
	$return['paidian_id']=$paidian['id'];
	$return['showtype']='paidian';
	$return['params']['type']=1;
	exi($return);
}
if($_RQ['op']=='getlist'){	
	$params=array('uniacid'=>$_SESSION['uniacid'],'status'=>1);
	$params['paidian_id']=$this->session('paidian_id');
	$pindex = max(1, intval($_RQ['page']));
	$psize = 10;
	$total='';
	$list=pdo_getslice('jy_lvpai_kepian',$params,array($pindex,$psize),$total,'','','paixu desc,id desc');
	if($list){
		foreach($list as &$item){
			$item['createtime']=date('m-d',$item['createtime']);
			$item['pcd']=json_decode($item['pcd'],true);
			$item['xiainum']=rand(200,1000);
		}
	}
	$return['list']=$list;
	exi($return);
}